/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.user.dto.UpdateFuelBalanceDTO;
import com.pig4cloud.pigx.user.entity.FuelAccount;
import com.pig4cloud.pigx.user.entity.User;
import com.pig4cloud.pigx.user.vo.LoginUserFuelVO;

import java.math.BigDecimal;

/**
 * 燃料账户
 *
 * @author pigx code generator
 * @date 2022-11-23 14:43:55
 */
public interface FuelAccountService extends IService<FuelAccount> {

	/**
	 * 用户注册时生成燃料账户
	 * @param user user
	 */
	void createFuel(User user);

	/**
	 * 获取当前登录用户的燃料余额
	 * @return r
	 */
	R<LoginUserFuelVO> getUserFuel();

	/**
	 * 获取用户燃油余额
	 * @param userId 用户id
	 * @param currency 币种
	 * @return BigDecimal
	 */
	BigDecimal getBalance(Long userId,String currency);

	/**
	 * 修改用户燃油余额
	 * @return 扣除之后的余额
	 */
	BigDecimal updateBalance(UpdateFuelBalanceDTO dto);

}
